/*
 * @Description: 
 * @Author: zoe
 * @Date: 2024-09-04 11:24:39
 * @LastEditors: rendc
 * @LastEditTime: 2024-09-04 14:50:52
 */
import java.util.Arrays;
public class Test02ArrayUtil{
    //main
    public static void main(String[] args){
        /*int[] array = {1,2,3,4,5,6,7,8};
        //获得数组的字符串输出
        String arrayStr = Arrays.toString(array);
        System.out.println("arrayStr:"+arrayStr);
        System.out.println("array.length:"+array.length);
        //拷贝数组
        array = Arrays.copyOf(array,10);
        System.out.println("array.length:"+array.length);
        System.out.println("Arrays.toString(array):"+Arrays.toString(array));*/
        /*//数组排序
        int[] arr1 = new int[]{1,3,5,2,4,6,8,7,10,15};
        System.out.println("Arrays.toString(arr1):"+Arrays.toString(arr1));
        System.out.println("排序");
        Arrays.sort(arr1);//是否有返回值：没有  是否改变原数组：改变
        System.out.println("Arrays.toString(arr1):"+Arrays.toString(arr1));*/


        /*String[] arr1 = {"1","10","12","300","30","20","2","3"};
        System.out.println("Arrays.toString(arr1):"+Arrays.toString(arr1));
        System.out.println("排序");
        Arrays.sort(arr1);//是否有返回值：没有  是否改变原数组：改变
        System.out.println("Arrays.toString(arr1):"+Arrays.toString(arr1));*/


        //fill
        int[] arr1 = new int[]{1,3,5,2,4,6,8,7,9,10};
        System.out.println("Arrays.toString(arr1):"+Arrays.toString(arr1));
        Arrays.fill(arr1,10);//没有返回值  改变原数组
        System.out.println("Arrays.toString(arr1):"+Arrays.toString(arr1));




    }
}
